using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using QL_LuanVan.DTO;
using System.Data;
using System.Data.SqlClient;

namespace DAOLayer
{
    public class DAOLoaiMonHoc:DataProvider
    {
        public DAOLoaiMonHoc()
        {
        }
        public ArrayList LayMang_LoaiMon()
        {
            connect();
            ArrayList arr = new ArrayList();
            try
            {
                SqlCommand cmd = new SqlCommand("sp_Select_LoaiMonHoc", strCnn);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    DTOLoaiMonHoc loaimondto = new DTOLoaiMonHoc();
                    loaimondto.MaLoai = dr.GetInt32(0);
                    loaimondto.TenLoai = dr.GetString(1);
                    arr.Add(loaimondto);
                }
            }
            catch(Exception e )
            {
                throw e;
            }
            return arr;
        }
      

    }
}
